<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>File Source for translations.php</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
		</head>
		<body>
						<h1>Source for file translations.php</h1>
<p>Documentation is available at <a href="../LIST_DMZ_Extensions/_extensions---translations.php.html">translations.php</a></p>
<div class="src-code">
<div class="src-code"><ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;class&nbsp;adds&nbsp;posibility&nbsp;to&nbsp;set&nbsp;ordering&nbsp;of&nbsp;table&nbsp;for&nbsp;column&nbsp;using&nbsp;L.I.S.T.&nbsp;translations&nbsp;methods&nbsp;(constants&nbsp;and&nbsp;overlays).</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;Andrej&nbsp;Jursa</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;LIST_DMZ_Extensions</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a9"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-key">class&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html">DMZ_Translations</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a11"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a12"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;sorting&nbsp;of&nbsp;table&nbsp;on&nbsp;table&nbsp;level&nbsp;(not&nbsp;for&nbsp;deep&nbsp;relation),&nbsp;for&nbsp;column&nbsp;which&nbsp;is&nbsp;translated&nbsp;by&nbsp;language&nbsp;constant.</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$direction&nbsp;</span><span class="src-doc">sorting&nbsp;direction&nbsp;(asc&nbsp;|&nbsp;desc).</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$constant_prefix&nbsp;</span><span class="src-doc">prefix&nbsp;of&nbsp;user&nbsp;constant,&nbsp;default&nbsp;is&nbsp;'user_custom_'.</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a21"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_with_constant">order_by_with_constant</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction&nbsp;</span>=&nbsp;<span class="src-str">'asc'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$constant_prefix&nbsp;</span>=&nbsp;<span class="src-str">'user_custom_'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a22"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a23"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a24"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a25"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-str">FROM&nbsp;`translations`</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-str">WHERE&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;CONCAT(&quot;lang:&quot;,&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$constant_prefix</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;,&nbsp;`constant`)&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">))&nbsp;</span>.&nbsp;<span class="src-str">'</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">))&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`sorting_text`&nbsp;LIMIT&nbsp;1)&nbsp;'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$direction</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'asc'&nbsp;</span>?&nbsp;<span class="src-str">'ASC'&nbsp;</span>:&nbsp;<span class="src-str">'DESC'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a30"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a31"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">ar_orderby</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$subquery</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a32"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a34"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;sorting&nbsp;of&nbsp;table&nbsp;on&nbsp;table&nbsp;level&nbsp;(not&nbsp;for&nbsp;deep&nbsp;relation),&nbsp;for&nbsp;column&nbsp;which&nbsp;is&nbsp;translated&nbsp;by&nbsp;language&nbsp;overlay.</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$direction&nbsp;</span><span class="src-doc">sorting&nbsp;direction&nbsp;(asc&nbsp;|&nbsp;desc).</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a43"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_with_overlay">order_by_with_overlay</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction&nbsp;</span>=&nbsp;<span class="src-str">'asc'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a44"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-str">FROM&nbsp;`lang_overlays`</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-str">WHERE&nbsp;`table`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`column`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`table_id`&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.`id`&nbsp;AND&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`text`&nbsp;!=&nbsp;&quot;&quot;</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-str">LIMIT&nbsp;1)&nbsp;'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$direction</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'asc'&nbsp;</span>?&nbsp;<span class="src-str">'ASC'&nbsp;</span>:&nbsp;<span class="src-str">'DESC'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">ar_orderby</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$subquery</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;sorting&nbsp;of&nbsp;table&nbsp;deepest&nbsp;level&nbsp;in&nbsp;related&nbsp;table&nbsp;field.</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$related&nbsp;</span><span class="src-doc">slash&nbsp;separated&nbsp;list&nbsp;of&nbsp;deeply&nbsp;related&nbsp;models.</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$direction&nbsp;</span><span class="src-doc">sorting&nbsp;direction&nbsp;(asc&nbsp;|&nbsp;desc).</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$constant_prefix&nbsp;</span><span class="src-doc">prefix&nbsp;of&nbsp;user&nbsp;constant,&nbsp;default&nbsp;is&nbsp;'user_custom_'.</span></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a67"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_related_with_constant">order_by_related_with_constant</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$related</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction&nbsp;</span>=&nbsp;<span class="src-str">'asc'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$constant_prefix&nbsp;</span>=&nbsp;<span class="src-str">'user_custom_'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">)&nbsp;</span>||&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_with_constant">order_by_with_constant</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom</span><span class="src-sym">,&nbsp;</span><span class="src-var">$constant_prefix</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$related_table&nbsp;</span>=&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">_add_related_table</span><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">,&nbsp;</span><span class="src-var">$object</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-str">FROM&nbsp;`translations`</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-str">WHERE&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;CONCAT(&quot;lang:&quot;,&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$constant_prefix</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;,&nbsp;`constant`)&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$related_table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">))&nbsp;</span>.&nbsp;<span class="src-str">'</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$related_table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">))&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-str">LIMIT&nbsp;1)&nbsp;'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$direction</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'asc'&nbsp;</span>?&nbsp;<span class="src-str">'ASC'&nbsp;</span>:&nbsp;<span class="src-str">'DESC'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">ar_orderby</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$subquery</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a88"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;sorting&nbsp;of&nbsp;table&nbsp;deepest&nbsp;level&nbsp;in&nbsp;related&nbsp;table&nbsp;field.</span></div></li>
<li><div class="src-line"><a name="a89"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$related&nbsp;</span><span class="src-doc">slash&nbsp;separated&nbsp;list&nbsp;of&nbsp;deeply&nbsp;related&nbsp;models.</span></div></li>
<li><div class="src-line"><a name="a91"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$direction&nbsp;</span><span class="src-doc">sorting&nbsp;direction&nbsp;(asc&nbsp;|&nbsp;desc).</span></div></li>
<li><div class="src-line"><a name="a93"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_related_with_overlay">order_by_related_with_overlay</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$related</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction&nbsp;</span>=&nbsp;<span class="src-str">'asc'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/is_string">is_string</a><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">)&nbsp;</span>||&nbsp;<a href="http://www.php.net/trim">trim</a><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodorder_by_with_overlay">order_by_with_overlay</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$direction</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$related_table&nbsp;</span>=&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">_add_related_table</span><span class="src-sym">(</span><span class="src-var">$related</span><span class="src-sym">,&nbsp;</span><span class="src-var">$object</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$rfs&nbsp;</span>=&nbsp;<a href="http://www.php.net/explode">explode</a><span class="src-sym">(</span><span class="src-str">'/'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$related</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$final_relation_model&nbsp;</span>=&nbsp;<a href="http://www.php.net/array_pop">array_pop</a><span class="src-sym">(</span><span class="src-var">$rfs</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$final_relation_model&nbsp;</span>=&nbsp;<a href="http://www.php.net/strtoupper">strtoupper</a><span class="src-sym">(</span><span class="src-var">$final_relation_model</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span>.&nbsp;<a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><a href="http://www.php.net/substr">substr</a><span class="src-sym">(</span><span class="src-var">$final_relation_model</span><span class="src-sym">,&nbsp;</span><span class="src-num">1</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$final_model&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-var">$final_relation_model</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-str">FROM&nbsp;`lang_overlays`</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-str">WHERE&nbsp;`table`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$final_model</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`column`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`table_id`&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$related_table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.`id`&nbsp;AND&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`text`&nbsp;!=&nbsp;&quot;&quot;</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$related_table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`sorting_text`</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-str">LIMIT&nbsp;1)&nbsp;'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><a href="http://www.php.net/strtolower">strtolower</a><span class="src-sym">(</span><span class="src-var">$direction</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-str">'asc'&nbsp;</span>?&nbsp;<span class="src-str">'ASC'&nbsp;</span>:&nbsp;<span class="src-str">'DESC'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">ar_orderby</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$subquery</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;like&nbsp;condition&nbsp;to&nbsp;where&nbsp;clause&nbsp;for&nbsp;column&nbsp;which&nbsp;can&nbsp;contain&nbsp;language&nbsp;constant.</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span><span class="src-doc">search&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span><span class="src-doc">wraping&nbsp;constant,&nbsp;can&nbsp;be&nbsp;'both',&nbsp;'before',&nbsp;'after'.</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$strip_html&nbsp;</span><span class="src-doc">if&nbsp;set&nbsp;to&nbsp;TRUE&nbsp;it&nbsp;will&nbsp;strip&nbsp;html&nbsp;tags&nbsp;from&nbsp;column.</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$constant_prefix&nbsp;</span><span class="src-doc">prefix&nbsp;of&nbsp;user&nbsp;constant,&nbsp;default&nbsp;is&nbsp;'user_custom_'.</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a129"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodlike_with_constant">like_with_constant</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-str">'both'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$strip_html&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$constant_prefix&nbsp;</span>=&nbsp;<span class="src-str">'user_custom_'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$like&nbsp;</span>=&nbsp;<span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'before'&nbsp;</span>?&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>:&nbsp;<span class="src-sym">(</span><span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'after'&nbsp;</span>?&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'&nbsp;</span>:&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">'fnStripTags('&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-str">FROM&nbsp;`translations`</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-str">WHERE&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;CONCAT(&quot;lang:&quot;,&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$constant_prefix</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;,&nbsp;`constant`)&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-str">LIMIT&nbsp;1)'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">')&nbsp;COLLATE&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">dbcollat&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;LIKE&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$like&nbsp;</span>.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(</span><span class="src-var">$subquery</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;like&nbsp;condition&nbsp;to&nbsp;where&nbsp;clause,&nbsp;with&nbsp;OR&nbsp;operator,&nbsp;for&nbsp;column&nbsp;which&nbsp;can&nbsp;contain&nbsp;language&nbsp;constant.</span></div></li>
<li><div class="src-line"><a name="a150"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a151"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a152"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span><span class="src-doc">search&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a153"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span><span class="src-doc">wraping&nbsp;constant,&nbsp;can&nbsp;be&nbsp;'both',&nbsp;'before',&nbsp;'after'.</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$strip_html&nbsp;</span><span class="src-doc">if&nbsp;set&nbsp;to&nbsp;TRUE&nbsp;it&nbsp;will&nbsp;strip&nbsp;html&nbsp;tags&nbsp;from&nbsp;column.</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$constant_prefix&nbsp;</span><span class="src-doc">prefix&nbsp;of&nbsp;user&nbsp;constant,&nbsp;default&nbsp;is&nbsp;'user_custom_'.</span></div></li>
<li><div class="src-line"><a name="a157"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodor_like_with_constant">or_like_with_constant</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-str">'both'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$strip_html&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$constant_prefix&nbsp;</span>=&nbsp;<span class="src-str">'user_custom_'</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$like&nbsp;</span>=&nbsp;<span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'before'&nbsp;</span>?&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>:&nbsp;<span class="src-sym">(</span><span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'after'&nbsp;</span>?&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'&nbsp;</span>:&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">'fnStripTags('&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a166"></a><span class="src-str">FROM&nbsp;`translations`</span></div></li>
<li><div class="src-line"><a name="a167"></a><span class="src-str">WHERE&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;CONCAT(&quot;lang:&quot;,&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$constant_prefix</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;,&nbsp;`constant`)&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'</span></div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-str">LIMIT&nbsp;1)'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">')&nbsp;COLLATE&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">dbcollat&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;LIKE&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$like&nbsp;</span>.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">or_where</span><span class="src-sym">(</span><span class="src-var">$subquery</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;like&nbsp;condition&nbsp;to&nbsp;where&nbsp;clause&nbsp;for&nbsp;column&nbsp;which&nbsp;can&nbsp;be&nbsp;translated&nbsp;with&nbsp;language&nbsp;overlay.</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a180"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a181"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span><span class="src-doc">search&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a182"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span><span class="src-doc">wraping&nbsp;constant,&nbsp;can&nbsp;be&nbsp;'both',&nbsp;'before',&nbsp;'after'.</span></div></li>
<li><div class="src-line"><a name="a183"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$strip_html&nbsp;</span><span class="src-doc">if&nbsp;set&nbsp;to&nbsp;TRUE&nbsp;it&nbsp;will&nbsp;strip&nbsp;html&nbsp;tags&nbsp;from&nbsp;column.</span></div></li>
<li><div class="src-line"><a name="a184"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a185"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a186"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodlike_with_overlay">like_with_overlay</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-str">'both'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$strip_html&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$like&nbsp;</span>=&nbsp;<span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'before'&nbsp;</span>?&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>:&nbsp;<span class="src-sym">(</span><span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'after'&nbsp;</span>?&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'&nbsp;</span>:&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">'fnStripTags('&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a194"></a><span class="src-str">FROM&nbsp;`lang_overlays`</span></div></li>
<li><div class="src-line"><a name="a195"></a><span class="src-str">WHERE&nbsp;`table`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`table_id`&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.`id`&nbsp;AND&nbsp;`column`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;</span></div></li>
<li><div class="src-line"><a name="a196"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a197"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a198"></a><span class="src-str">LIMIT&nbsp;1)'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">')&nbsp;COLLATE&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">dbcollat&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;LIKE&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$like&nbsp;</span>.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">where</span><span class="src-sym">(</span><span class="src-var">$subquery</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;Add&nbsp;like&nbsp;condition&nbsp;to&nbsp;where&nbsp;clause,&nbsp;with&nbsp;OR&nbsp;operator,&nbsp;for&nbsp;column&nbsp;which&nbsp;can&nbsp;be&nbsp;translated&nbsp;with&nbsp;language&nbsp;overlay.</span></div></li>
<li><div class="src-line"><a name="a207"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc-var">$object&nbsp;</span><span class="src-doc">model&nbsp;object&nbsp;which&nbsp;will&nbsp;be&nbsp;using&nbsp;this&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$column&nbsp;</span><span class="src-doc">column&nbsp;name&nbsp;in&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$value&nbsp;</span><span class="src-doc">search&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span><span class="src-doc">wraping&nbsp;constant,&nbsp;can&nbsp;be&nbsp;'both',&nbsp;'before',&nbsp;'after'.</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">bool&nbsp;</span><span class="src-doc-var">$strip_html&nbsp;</span><span class="src-doc">if&nbsp;set&nbsp;to&nbsp;TRUE&nbsp;it&nbsp;will&nbsp;strip&nbsp;html&nbsp;tags&nbsp;from&nbsp;column.</span></div></li>
<li><div class="src-line"><a name="a212"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$lang_idiom&nbsp;</span><span class="src-doc">language&nbsp;idiom,&nbsp;default&nbsp;is&nbsp;NULL&nbsp;=&nbsp;current&nbsp;language&nbsp;idion&nbsp;set&nbsp;in&nbsp;language&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">DataMapper&nbsp;</span><span class="src-doc">returns&nbsp;object&nbsp;for&nbsp;method&nbsp;chaining.</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a215"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../LIST_DMZ_Extensions/DMZ_Translations.html#methodor_like_with_overlay">or_like_with_overlay</a><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">,&nbsp;</span><span class="src-var">$column</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-str">'both'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$strip_html&nbsp;</span>=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">,&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a216"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$CI&nbsp;</span>=<span class="src-sym">&amp;&nbsp;</span><span class="src-id">get_instance</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a217"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><a href="http://www.php.net/is_null">is_null</a><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{&nbsp;</span><span class="src-var">$lang_idiom&nbsp;</span>=&nbsp;<span class="src-var">$CI</span><span class="src-sym">-&gt;</span><span class="src-id">lang</span><span class="src-sym">-&gt;</span><span class="src-id">get_current_idiom</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a218"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a219"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$like&nbsp;</span>=&nbsp;<span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'before'&nbsp;</span>?&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>:&nbsp;<span class="src-sym">(</span><span class="src-var">$wrap&nbsp;</span>==&nbsp;<span class="src-str">'after'&nbsp;</span>?&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'&nbsp;</span>:&nbsp;<span class="src-str">'%'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_like_str</span><span class="src-sym">(</span><span class="src-var">$value</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'%'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$subquery&nbsp;</span>=&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">'fnStripTags('&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'(SELECT&nbsp;`text`&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-str">FROM&nbsp;`lang_overlays`</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-str">WHERE&nbsp;`table`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`table_id`&nbsp;=&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.`id`&nbsp;AND&nbsp;`column`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;&nbsp;AND&nbsp;`idiom`&nbsp;=&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">escape_str</span><span class="src-sym">(</span><span class="src-var">$lang_idiom</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&quot;</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-str">UNION</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-str">SELECT&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">table</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'.'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">protect_identifiers</span><span class="src-sym">(</span><span class="src-var">$column</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;AS&nbsp;`like_text`</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-str">LIMIT&nbsp;1)'&nbsp;</span>.&nbsp;<span class="src-sym">(</span><span class="src-var">$strip_html&nbsp;</span>===&nbsp;<span class="src-id">TRUE&nbsp;</span>?&nbsp;<span class="src-str">')&nbsp;COLLATE&nbsp;'&nbsp;</span>.&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">db</span><span class="src-sym">-&gt;</span><span class="src-id">dbcollat&nbsp;</span>:&nbsp;<span class="src-str">''</span><span class="src-sym">)&nbsp;</span>.&nbsp;<span class="src-str">'&nbsp;LIKE&nbsp;&quot;'&nbsp;</span>.&nbsp;<span class="src-var">$like&nbsp;</span>.&nbsp;<span class="src-str">'&quot;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a227"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$object</span><span class="src-sym">-&gt;</span><span class="src-id">or_where</span><span class="src-sym">(</span><span class="src-var">$subquery</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a229"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a230"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$object</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a231"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a233"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a235"></a><span class="src-comm">/*&nbsp;End&nbsp;of&nbsp;file&nbsp;translations.php&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a236"></a><span class="src-comm">/*&nbsp;Location:&nbsp;./application/extensions/translations.php&nbsp;*/</span></div></li>
</ol></div>
</div>
	<p class="notes" id="credit">
		Documentation generated on Fri, 13 Sep 2013 12:32:58 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.4</a>
	</p>
	</body>
</html>